package com.hongyun.tms.common.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hongyun.tms.common.annotation.Dict;
import com.hongyun.tms.common.annotation.excel.ExcelInfo;
import com.hongyun.tms.infra.excel.converter.dict.DictConverter;
import com.hongyun.tms.infra.excel.converter.enums.RateTradeTypeEnumConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 船舶费率 响应
 *
 * @author liPeng
 * @date 2024-05-31
 **/
@Data
@ExcelInfo(fileName = "费率信息导出")
public class MRateVO implements Serializable {

    @ApiModelProperty(value = "ID")
    @ExcelIgnore
    private Long id;

    @ApiModelProperty(value = "船长-起")
    @ExcelIgnore
    private Integer lengthStart;

    @ApiModelProperty(value = "船长-止")
    @ExcelIgnore
    private Integer lengthEnd;

    @ExcelProperty(value = "船长", index = 0)
    private String lengthStr;
    @ApiModelProperty(value = "贸别：内贸，外贸")
    @ExcelProperty(value = "贸别", converter = RateTradeTypeEnumConverter.class, index = 1)
    private String tradeType;

    @ApiModelProperty(value = "船舶类型代码")
    @ExcelProperty(value = "船舶类型", converter = DictConverter.class, index = 2)
    @Dict(code = "SHIP_KIND", fieldName = "shipKindName")
    private String shipKindCode;

//    @ApiModelProperty(value = "船舶类型名称")
//    @ExcelIgnore
//    private String shipKindName;

    @ApiModelProperty(value = "费率")
    @ExcelProperty(value = "费率", index = 3)
    private Long rate;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private LocalDateTime updateTime;
}

